package com.hmdp.ThreadUtil.pc;/**
 * @Author:fengxiaohui
 * @Description:
 * @Date:Create in 5:03 下午 2023/6/7
 * @Modified By:
 */

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.Vector;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 *@Author:fengxiaohui
 *@Description:
 *@Date:Create in 5:03 下午 2023/6/7
 *@Modified By:
 */
public class ThreadData {

    public static void main(String[] args) {
        List<String> list = new CopyOnWriteArrayList<>();

        for (int i = 0; i <= 20 ; i++) {
            new Thread(() -> {
                list.add(UUID.randomUUID().toString().substring(0, 5));
                System.out.println(list);
            },String.valueOf(i)).start();
        }

    }
}
